package com.colt.contentcenter.domain.entity.city;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
//将该标记放在属性上，如果该属性为NULL则不参与序列化

//如果放在类上边,那对这个类的全部属性起作用

//Include.ALWAYS 默认

//Include.NON_DEFAULT 属性为默认值不序列化

//Include.NON_EMPTY 属性为空（“”）或者为 NULL 都不序列化

//Include.NON_NULL 属性为NULL 不序列化
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@Table(name = "city")
public class City implements java.io.Serializable{
    @Id
    @GeneratedValue(generator = "JDBC")
    private Integer id;

    private Integer pid;

    private String cityname;

    private Integer type;

    private List<City> children;

    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return pid
     */
    public Integer getPid() {
        return pid;
    }

    /**
     * @param pid
     */
    public void setPid(Integer pid) {
        this.pid = pid;
    }

    /**
     * @return cityname
     */
    public String getCityname() {
        return cityname;
    }

    /**
     * @param cityname
     */
    public void setCityname(String cityname) {
        this.cityname = cityname;
    }

    /**
     * @return type
     */
    public Integer getType() {
        return type;
    }

    /**
     * @param type
     */
    public void setType(Integer type) {
        this.type = type;
    }
}